Subject: Re: SAS6.1 users: please read
From: [email-masked] (James Cooper)
Date: 4 Dec 92 18:53:14 GMT
Newsgroups: comp.sys.amiga.programmer

In article <[email-masked]>, [email-masked] (Steve Koren) writes:
>LORETI, Maurizio ([email-masked]) wrote:
>> Is this a real error? strlen returns a size_t argument
>> according with ANSI, and size_t (defined in <stddef.h>) is
>
>Maybe you're right; maybe its supposed to because size_t is unsigned int
>even though num is signed.
>
>However, at the very least it is something to be aware of, because when
>I compile this under 5.10b it does just the opposite thing with the same
>code :-)
>
>I can believe the program is doing the correct thing by ANSI standards.
>But personally, I'd expect the result of doing arithmetic on a signed
>and unsigned int to result in a signed number.

Maurizio is correct.  Your code is operating according to the ANSI
standard rules for handling mathematics on different types (unsigned vs
signed).  Therefore, this cannot be "fixed"...

It is something worth noting, though.  Perhaps we can add it to Appendix
5, "Converting from Version 5 to Version 6" in the next set of manuals
(and update pages, when we do 'em).

-- 
---------------
Jim Cooper
([email-masked])                             bix: jcooper

Any opinions expressed herein are mine (Mine, all mine!  Ha, ha, ha!),
and not necessarily those of my employer.